<ui:composition template="../template/template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
	<ui:define name="localizacao">
		<h:outputText value="&#160;" />
		<a href="listarConcursos.xhtml"> Concursos</a>
		<h:outputText value="&#160;>&#160; Calendario" />
	</ui:define>
	<ui:define name="content">

		<div class="arrow fright">
			<p:commandButton actionListener="#{concursoMB.buscar()}" icon="ui-icon-note"
				title="Visualizar em lista" value="Visualizar lista" />
				<br /><br />
				<p:commandButton  readonly="true" styleClass="ui-priority-primary" value="  "/>
				<h:outputText value="Concursos" />
				<br />
				<p:commandButton id="legendaLembretes" readonly="true" value="  "/>
				<h:outputText value="Lembretes" />
		</div>
		
		<br />
		<div class="arrow fright">
		 
		</div>
		
		<br />
		<br />
		<h:form id="form">
			<p:growl id="messages" showDetail="true" sticky="false" life="5000" />
			<p:schedule id="schedule" value="#{scheduleController.eventModel}" widgetVar="myschedule"
				editable="true" locale="pt" draggable="false" rightHeaderTemplate="" timeFormat="">
				<p:ajax event="dateSelect" listener="#{scheduleController.onDateSelect}"
					update="cadastrarLembrete" oncomplete="eventDialog.show()" />
				<p:ajax event="eventSelect" listener="#{scheduleController.onEventSelect}"
					oncomplete="eventDialog.show()" />
				<p:ajax event="eventMove" listener="#{scheduleController.onEventMove}" update="messages" />
				<p:ajax event="eventResize" listener="#{scheduleController.onEventResize}" update="messages" />
			</p:schedule>


			<p:dialog widgetVar="eventDialog" header="Adicionar Lembrete" showEffect="clip" hideEffect="clip"
				modal="true" height="400">
				<h:panelGrid id="cadastrarLembrete">
					<table>
						<tr>
							<td><h:outputText value="Concurso: " /></td>

							<td><p:selectOneMenu id="concurso" value="#{scheduleController.id_concurso_selecionado}">
									<f:selectItems value="#{scheduleController.listaConcursos}" var="concurso"
										itemValue="#{concurso.id}" itemLabel="#{concurso.nome}" />
								</p:selectOneMenu></td>
						</tr>
						<tr>
							<td><h:outputText value="Titulo: " /></td>
							<td><p:inputText id="titulo" value="#{scheduleController.lembrete.titulo}"
									required="true" requiredMessage="Campo obrigatorio" /></td>
							<td><p:message for="titulo" /></td>
						</tr>
						<tr>
							<td><h:outputText value="Informacao: " /></td>
							<td><p:inputText id="informacao" value="#{scheduleController.lembrete.informacao}"
									required="true" requiredMessage="Campo obrigatorio" /></td>
							<td><p:message for="informacao" /></td>
						</tr>
						<tr>
							<td><h:outputText value="Data do lembrete: " /></td>
							<td><p:inputText id="data_lembrete" locale="pt" showButtonPanel="true" required="true"
									navigator="true" requiredMessage="Campo obrigatorio" pattern="dd/MM/yyyy"
									yearRange="c-50:c-0" value="#{scheduleController.event.startDate}" readonly="true">
									<f:convertDateTime pattern="dd/MM/yyyy" />
								</p:inputText></td>
							<td><p:message for="data_lembrete" /></td>
						</tr>
						<tr>
							<td><h:outputText value="Enviar E-mail: " /></td>
							<td><p:selectBooleanCheckbox value="#{scheduleController.lembrete.enviarEmail}" /></td>
						</tr>
						<tr>
							<td><br /></td>
						</tr>
						<tr>
							<td><p:commandButton id="addButton" value="Adicionar"
									actionListener="#{scheduleController.addEvent}"
									oncomplete="myschedule.update();eventDialog.hide();" update="form, :form:messages"
									styleClass="ui-priority-primary" /></td>
						</tr>
					</table>





				</h:panelGrid>
			</p:dialog>
		</h:form>

	</ui:define>
</ui:composition>